<template>
	<VrRender :imageName="imageName"></VrRender>
</template>


<script>
	import VrRender from './render.vue'
	export default {
		components: {
			VrRender
		},
		data() {
			return {
				// 图片完整地址（路径+图片名）
				imageURL: '',
				// 图片名称
				imageName: '',
				// 图片路径
				location: '',
				// 屏幕宽高
				windowWidth: 300,
				windowHeight: 600,
			}
		},
		onLoad(options) {
			console.log("vr onload", options.imageurl);
			if (options.imageurl != undefined && options.location != undefined) {
				this.imageName = decodeURIComponent(options.imageurl)
				// 使用require无法获取动态路径？？
				this.location = decodeURIComponent(options.location)
				// this.imageURL = require('./'+this.location+this.imageName)
			} else {
				console.log("没有携带参数，加载北欧卧室");
				this.imageName = 'BeiOu-WoShi.jpeg'
			}
		},
		mounted() {
			console.log("vr mounted");
			// 获取屏幕宽高
			// this.getScreenSize()
		},
		methods: {
			getScreenSize() {
				uni.getSystemInfo({
					success: (res) => {
						this.windowWidth = res.windowWidth; // 屏幕宽度，单位为px
						this.windowHeight = res.windowHeight; // 屏幕高度，单位为px
					},
				});
			},
		},
	}
</script>

<style>
</style>